<div class="col-lg-6">

<h2><%= translation('users.reset.reset_password') %></h2>

<hr />

<% if params[:key] && User.find_by(reset_key: params[:key]) %>

<p><%= translation('users.reset.enter_username_and_password') %>:</p>

<form class='form'>

  <input class="form-control" name="key" type="hidden" value="<%= params[:key] %>" /> 
  <input class="form-control" name="user[username]" placeholder="<%= translation('users.reset.username_placeholder',{},false) %>" tabindex='2' type="text" /> <br />
  <input class="form-control" name="user[password]" placeholder="<%= translation('users.reset.password_placeholder',{},false) %>" tabindex='3' type="password" /> <br />
  <input class="form-control" name="user[password_confirmation]" placeholder="<%= translation('users.reset.retype_password_placeholder',{},false) %>" tabindex='4' type="password" /> <br />

  <button class="btn btn-lg btn-primary" type="submit" tabindex="5"><%= translation('users.reset.save') %></button>

</form>

<% else %>
<p><%= translation('users.reset.enter_email_reset_password') %>:</p>

<form action="/reset/" class='form'>

  <div class="alert alert-danger" id="validPrint" style="display:none"> </div>

  <input class="form-control" name="email" id='validEmail' placeholder="you@example.com" tabindex='2' type="text" /> <br />

  <button class="btn btn-lg btn-primary" id="validBtn" type="submit" tabindex="3"><%= translation('users.reset.reset') %></button>

</form>

<% end %>

</div>

<script type="text/javascript">
    $("#validBtn").click(function(event) {
        const reset = new Reset;
        reset.runValidation(event);
    });
</script>
